package ch4.ex1;

import javax.swing.JOptionPane;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;


public class JavaArray1 {

	public static void main(String[] args) {
		Integer[] nums = { 10, 20, 30, 40 };
		String[] family = { "marek", "iwona", "mikolaj", "oliwka" };
		System.out.println(nums[0]);
		System.out.println(nums[1]);
		System.out.println(nums[2]);

		int idx = 0;
		while (idx < nums.length) {
			System.out.println(nums[idx]);
			idx++;
		}
		for (Integer num : nums) {
			System.out.println("w" + num);
		}
		int ida = 0;
		while (ida < family.length) {
			System.out.println(family[ida]);
			JOptionPane.showMessageDialog(null, family[ida]);
			System.out.println(ida);

			ida++;

		}
		List<String> family1 = new ArrayList<String>(family.length);
		for (String e : family) {
			System.out.println(e);
			family1.add(e);
			
		}
	}

}
